<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue 网络请求</title>
</head>
<body>
<div id="app">

</div>

<script type="module">
    import {createApp, onMounted} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup() {
                onMounted(
                    () => {
                        fetch(
                            "https://httpbin.org/get?name=abc&gender=man",
                            {
                                method: "GET",
                            },

                        ).then(resp => {
                            // console.log(resp);
                            return resp.json()

                        })
                            .then(data=>{
                                console.log(data.args);
                            })
                    }
                )
                return {}
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>